package com.cysion.study.net

import com.cysion.study.customview.java.SimpleData
import com.cysion.study.entity.*
import com.cysion.study.ktbox.net.BaseCaller
import com.cysion.study.ktbox.net.BaseResponse
import com.cysion.study.widget.indexableBar.AddressUser
import io.reactivex.Observable
import okhttp3.Interceptor
import okhttp3.RequestBody
import okhttp3.Response
import retrofit2.http.*
import java.io.File

object ApiClient : BaseCaller<UserApi>(Urls.HOST, UserApi::class.java) {
    override fun beforeInit() {
        addInterceptor(object : Interceptor {
            override fun intercept(chain: Interceptor.Chain): Response {
                val builder = chain.request().newBuilder()
                /*if (!TextUtils.isEmpty(UserCache.userId)) {
                    builder.addHeader("userid", UserCache.userId)
                }
               var token=  ACache.get(Box.context).getAsString("token")
                builder.addHeader("token", token)*/
                return chain.proceed(builder.build())
            }
        })
    }
}

interface UserApi {


    /////////////////////////////旧例子////////////////////////////////////////////
    //    顶部轮播
    @GET("toploopers")
    fun getCarousel(): Observable<BaseResponse<MutableList<Carousel>>>

    //注册
    @FormUrlEncoded
    @POST("register")
    fun register(
        @Field("phone") phone: String,
        @Field("type") type: String,
        @Field("password") password: String,
        @Field("code") code: String
    ): Observable<BaseResponse<UserEntity>>

    //登录
    @FormUrlEncoded
    @POST("login")
    fun login(
        @Field("username") username: String,
        @Field("password") password: String
    ): Observable<BaseResponse<UserEntity>>


    //更新用户信息
    @FormUrlEncoded
    @POST("updateuser")
    fun updateUserInfo(
        @Field("nickname") nickname: String,
        @Field("desc") desc: String,
        @Field("avatar") avatar: String = ""
    ): Observable<BaseResponse<UserEntity>>

    //获取用户详情
    @POST("userdetail")
    fun getUserInfo(): Observable<BaseResponse<UserEntity>>

//    以下，博客相关

    //获取博客列表，时间顺序
    @GET("blog/list")
    fun getBlogList(@Query("page") page: Int = 1): Observable<BaseResponse<MutableList<Blog>>>


    //获取某个用户的博客
    @GET("blog/userlist")
    fun getUserBlogList(@Query("page") page: Int): Observable<BaseResponse<MutableList<Blog>>>

    //获取某个博客详情
    @GET("blog/get/{blogId}")
    fun getBlog(@Path("blogId") blogId: String): Observable<BaseResponse<Blog>>

    //删除博客
    @FormUrlEncoded
    @POST("blog/del")
    fun delBlog(@Field("blogId") blogId: String): Observable<BaseResponse<Any?>>


    //创建博客
    @FormUrlEncoded
    @POST("blog/add")
    fun createBlog(@Field("title") title: String, @Field("text") text: String): Observable<BaseResponse<Any?>>


    //更新博客
    @FormUrlEncoded
    @POST("blog/update")
    fun updateBlog(
        @Field("title") title: String, @Field("text") text: String
        , @Field("blogId") blogId: String
    ): Observable<BaseResponse<Any?>>


    //点赞博客
    @FormUrlEncoded
    @POST("blog/pride")
    fun prideBlog(@Field("blogId") blogId: String): Observable<BaseResponse<Any?>>


    //取消点赞博客
    @FormUrlEncoded
    @POST("blog/unpride")
    fun unPrideBlog(@Field("blogId") blogId: String): Observable<BaseResponse<Any?>>

    //收藏博客
    @FormUrlEncoded
    @POST("blog/collect")
    fun collectBlog(@Field("itemId") blogId: String): Observable<BaseResponse<Any?>>


    //取消收藏博客
    @FormUrlEncoded
    @POST("blog/uncollect")
    fun unCollectBlog(@Field("itemId") blogId: String): Observable<BaseResponse<Any?>>


    //博客收藏列表
    @POST("blog/collections")
    fun getCollectList(@Query("colType") colType: String = "0"): Observable<BaseResponse<MutableList<CollectEntity>>>


    //评论博客
    @FormUrlEncoded
    @POST("blog/comment")
    fun commentBlog(
        @Field("parentId") parentId: String,
        @Field("content") content: String
    ): Observable<BaseResponse<Any?>>


    //获取评论列表，时间顺序
    @GET("blog/comments/list")
    fun getComments(@Query("parentId") parentId: String): Observable<BaseResponse<MutableList<CommentEntity>>>


    //获得某个用户的详情
    @POST("userinfo")
    fun getPeopleInfo(
        @Body jsonBody: RequestBody
    ): Observable<BaseResponse<DetailUserEntity>>

//////////////////////////////////////////////////////////////////////////////

    //重置登录密码
    @FormUrlEncoded
    @POST("/education/teacher/login/reset")
    fun resetLogin(
        @Field("phone") phone: String,
        @Field("password") password: String,
        @Field("code") code: String
    ): Observable<BaseResponse<UserEntity>>

    //注册
    @FormUrlEncoded
    @POST("/education/teacher/login/register")
    fun registers(
        @Field("phone") phone: String,
        @Field("type") type: String,
        @Field("password") password: String,
        @Field("code") code: String
    ): Observable<BaseResponse<UserEntity>>

    //修改支付密码
    @FormUrlEncoded
    @POST("/education/teacher/teacher/setPayPassword")
    fun setPayPassword(
        @Field("password") password: String,
        @Field("code") code: String,
        @Field("token") token: String
    ): Observable<BaseResponse<Any?>>

    //验证验证码
    @FormUrlEncoded
    @POST("/education/teacher/common/checkCode")
    fun checkCode(
        @Field("phone") phone: String,
        @Field("type") type: String,
        @Field("code") code: String
    ): Observable<BaseResponse<Any?>>

    //发送验证码
    @FormUrlEncoded
    @POST("/education/teacher/common/sendMessageCode")
    fun sendCdoe(
        @Field("phone") phone: String,
        @Field("type") type: String
    ): Observable<BaseResponse<Any?>>

    //登录
    @FormUrlEncoded
    @POST("/education/teacher/login/do")
    fun logins(
        @Field("phone") username: String,
        @Field("password") password: String,
        @Field("type") type: String//登录类型 1.普通员工 1.私教
    ): Observable<BaseResponse<UserEntity>>

    //获取本周课程
    @FormUrlEncoded
    @POST("/education/teacher/course/getWeek")
    fun getCourse(
        @Field("token") token: String
    ): Observable<BaseResponse<MutableList<CourseEntity>>>


    //获取本月课程
    @FormUrlEncoded
    @POST("/education/teacher/course/getMonth")
    fun getMonth(
        @Field("token") token: String
    ): Observable<BaseResponse<MutableList<CourseEntity>>>

    //获取全部课程
    @FormUrlEncoded
    @POST("/education/teacher/course/getAllList")
    fun getCourseAll(
        @Field("token") token: String
    ): Observable<BaseResponse<MutableList<CourseEntity>>>

    @FormUrlEncoded
    @POST("/education/teacher/teacher/info")
    fun getUserInfos(
        @Field("token") token: String
    ): Observable<BaseResponse<UserEntity>>

    //获取所有省市数据
    @FormUrlEncoded
    @POST("/education/teacher/province/getAllList")
    fun getAllCity(
        @Field("token") token: String
    ): Observable<BaseResponse<MutableList<AddressBean>>>


    //待审批列表
    @FormUrlEncoded
    @POST("/education/teacher/approval/getOwnDealList")
    fun getOwnDealList(
        @Field("token") token: String,
        @Field("page") curPage: Int,
        @Field("category") category: Int
    ): Observable<BaseResponse<MutableList<ApprovalEntity>>>

    //已审批列表
    @FormUrlEncoded
    @POST("/education/teacher/approval/getOwnDealedList")
    fun getOwnDealedList(
        @Field("token") token: String,
        @Field("page") curPage: Int
    ): Observable<BaseResponse<MutableList<ApprovalEntity>>>

    //通知列表
    @FormUrlEncoded
    @POST("/education/teacher/notice/getList")
    fun getNoticeList(
        @Field("token") token: String,
        @Field("page") curPage: Int,
        @Field("cert") cert: String,
        @Field("startTime") startTime: String,
        @Field("endTime") endTime: String
    ): Observable<BaseResponse<MutableList<NoticeEntity>>>


    //获取教师打卡信息
    @FormUrlEncoded
    @POST("/education/teacher/checkWork/getInfo")
    fun getTeacherAtt(
        @Field("token") token: String,
        @Field("longitude") longitude: String,
        @Field("latitude") latitude: String
    ): Observable<BaseResponse<AttEntity>>

    //教师打卡
    @FormUrlEncoded
    @POST("/education/teacher/checkWork/clockIn")
    fun clockIn(
        @Field("token") token: String,
        @Field("remark") remark: String,
        @Field("longitude") longitude: String,
        @Field("latitude") latitude: String,
        @Field("address") address: String
    ): Observable<BaseResponse<Any?>>


    //获取机构全部员工集合,用于审核/抄送选择
    @FormUrlEncoded
    @POST("/education/teacher/staff/getAll")
    fun getAll(
        @Field("token") token: String,
        @Field("keyword") keyword: String
    ): Observable<BaseResponse<MutableList<String>>>

    //获取机构审批
    @FormUrlEncoded
    @POST("/education/teacher/approval/getInfo")
    fun approvalGetInfo(
        @Field("token") token: String,
        @Field("type") type: String
    ): Observable<BaseResponse<MutableList<String>>>


    //获取托管班级信息
    @FormUrlEncoded
    @POST("/education/teacher/classes/getOwn")
    fun getOwnClasses(
        @Field("token") token: String,
        @Field("isSign") isSign: String
    ): Observable<BaseResponse<SimpleData>>

    //获取课程班级信息
    @FormUrlEncoded
    @POST("/education/teacher/classes/getByClid")
    fun classesGetByClid(
        @Field("token") token: String,
        @Field("clid") clid: String,
        @Field("isSign") isSign: String
    ): Observable<BaseResponse<SimpleData>>

    //班级点名/托管签到
    @FormUrlEncoded
    @POST("/education/teacher/classes/rollCall")
    fun rollCall(
        @Field("token") token: String,
        @Field("clid") clid: String,
        @Field("sid") sid: String,
        @Field("type") type: String
    ): Observable<BaseResponse<Any?>>

    //提交审批
    @FormUrlEncoded
    @POST("/education/teacher/approval/release")
    fun approvalRelease(
        @Field("token") token: String,
        @Field("type") type: String,
        @Field("name") name: String,
        @Field("remark") remark: String,
        @Field("startTime") startTime: String,
        @Field("endTime") endTime: String,
        @Field("checkIds") checkIds: String,
        @Field("lookIds") lookIds: String,
        @Field("imageUrls") imageUrls: String,
        @Field("money") money: String,
        @Field("useTime") useTime: String,
        @Field("totalTime") totalTime: String
    ): Observable<BaseResponse<Any?>>

    //提交教师个人信息
    @FormUrlEncoded
    @POST("/education/teacher/teacher/setInfo")
    fun setInfo(
        @Field("token") token: String,
        @Field("nickName") nickName: String,
        @Field("backImageUrl") backImageUrl: String,
        @Field("headImageUrl") headImageUrl: String,
        @Field("birthday") birthday: String,
        @Field("city") city: String,
        @Field("province") province: String,
        @Field("address") address: String,
        @Field("sex") sex: String
    ): Observable<BaseResponse<Any?>>

    //提交家教个人信息
    @FormUrlEncoded
    @POST("/education/teacher/teacher/setInfo")
    fun teacherSetInfo(
        @Field("token") token: String,
        @Field("feduName") feduName: String,
        @Field("feduSex") feduSex: String,
        @Field("feduSchool") feduSchool: String,
        @Field("feduGrade") feduGrade: String,
        @Field("feduCareer") feduCareer: String,
        @Field("feduSuc") feduSuc: String,
        @Field("feduIntro") feduIntro: String,
        @Field("feduImages") feduImages: String
    ): Observable<BaseResponse<Any?>>

    //提交家教个人信息
    @FormUrlEncoded
    @POST("/education/teacher/index/uploadFile")
    fun upload(
        @Field("token") token: String,
        @Field("file") feduName: File
    ): Observable<BaseResponse<Any?>>


    //家教信息保存
    @FormUrlEncoded
    @POST("/education/teacher/familyeduInfo/save")
    fun submitFamilyeduInfo(
        @Field("token") token: String,
        @Field("categoryIds") categoryIds: String,
        @Field("categoryNames") categoryNames: String,
        @Field("cityId") cityId: String,
        @Field("cityName") cityName: String,
        @Field("types") types: String,
        @Field("supplement") supplement: String,
        @Field("explanation") explanation: String,
        @Field("address") address: String,
        @Field("times") times: String,
        @Field("latitude") latitude: String,
        @Field("longitude") longitude: String,
        @Field("fee") fee: String
    ): Observable<BaseResponse<Any?>>

    //获取家教信息
    @FormUrlEncoded
    @POST("/education/teacher/familyeduInfo/getInfo")
    fun familyeduInfoGetInfo(
        @Field("token") token: String
    ): Observable<BaseResponse<FamilyeduInfoEntity>>

    //处理通知/读取通知
    @FormUrlEncoded
    @POST("/education/teacher/notice/read")
    fun noticeRead(
        @Field("token") token: String,
        @Field("nid") nid: String,
        @Field("confirmResult") confirmResult: String
    ): Observable<BaseResponse<Any?>>

    //我的-审批申请
    @FormUrlEncoded
    @POST("/education/teacher/approval/deal")
    fun approvalDeal(
        @Field("token") token: String,
        @Field("aid") aid: String,
        @Field("agree") agree: String,
        @Field("remark") remark: String
    ): Observable<BaseResponse<Any?>>


    //提现记录
    @FormUrlEncoded
    @POST("/education/teacher/withdrawal/getList")
    fun getRecordList(
        @Field("token") token: String,
        @Field("page") curPage: Int,
        @Field("startTime") startTime: String,
        @Field("endTime") endTime: String,
        @Field("statuss") statuss: String
    ): Observable<BaseResponse<MutableList<RecordEntity>>>

    //我的银行卡
    @FormUrlEncoded
    @POST("/education/teacher/bankCard/getList")
    fun bankList(
        @Field("token") token: String,
        @Field("page") curPage: Int
    ): Observable<BaseResponse<MutableList<BankEntity>>>

    //银行
    @FormUrlEncoded
    @POST("/education/teacher/bankCard/getBanks")
    fun getBanks(
        @Field("token") token: String
    ): Observable<BaseResponse<MutableList<BankListEntity>>>

    //普通教师首页
    @FormUrlEncoded
    @POST("/education/teacher/index/formal/getInfo")
    fun formalGetInfo(
        @Field("token") token: String
    ): Observable<BaseResponse<HomeFormalEntity>>

    //普通教师--获取课程列表
    @FormUrlEncoded
    @POST("/education/teacher/researchStu/getAllResearchStuList")
    fun getAllResearchStuList(
        @Field("page") curPage: Int,
        @Field("token") token: String
    ): Observable<BaseResponse<MutableList<AllResearchStuEntity>>>

    //获取通讯录列表
    @FormUrlEncoded
    @POST("/education/teacher/staff/getAddressBook")
    fun getAddressBook(
        @Field("name") name: String,
        @Field("token") token: String
    ): Observable<BaseResponse<MutableList<AddressUser>>>

    //普通教师--获取课程 获取课时列表
    @FormUrlEncoded
    @POST("/education/teacher/researchStu/getAllCourseList")
    fun getAllCourseList(
        @Field("cid") cid: Int,//班级id
        @Field("researchId") researchId: Int,//课程id
        @Field("page") curPage: Int,
        @Field("token") token: String
    ): Observable<BaseResponse<MutableList<AllResearchStuEntity>>>


    //普通教师--获取课程 获取课时详情
    @FormUrlEncoded
    @POST("/education/teacher/researchStu/getDetailCourse")
    fun getDetailCourse(
        @Field("courseId") courseId: String,//课时id
        @Field("token") token: String
    ): Observable<BaseResponse<CourseDetailEntity>>
    //课时详情页-获取点评信息
    @FormUrlEncoded
    @POST("/education/teacher/deposit/getById")
    fun getComment(
        @Field("depositid") depositid: String,
        @Field("token") token: String
    ): Observable<BaseResponse<MutableList<CommentListEntity>>>

    //课时详情页-获取点评信息
    @FormUrlEncoded
    @POST("/education/teacher/deposit/getById")
    fun getCommentDetail(
        @Field("depositid") depositid: String,
        @Field("token") token: String
    ): Observable<BaseResponse<CommentListEntity>>

    //课时详情页-提交点评信息
    @FormUrlEncoded
    @POST("/education/teacher/deposit/submitComment")
    fun commintComment(
        @Field("courseId") courseId: String,
        @Field("stuid") stuid: String,
        @Field("comment") comment: String,
        @Field("imageUrl") imageUrl: String,
        @Field("token") token: String
    ): Observable<BaseResponse<Any?>>

    //私教首页
    @FormUrlEncoded
    @POST("/education/teacher/index/private/getInfo")
    fun privateInfo(
        @Field("token") token: String
    ): Observable<BaseResponse<HomePrivateEntity>>


    //获取教师的余额明细
    @FormUrlEncoded
    @POST("/education/teacher/balanceDetails/getList")
    fun balanceDetails(
        @Field("token") token: String,
        @Field("startTime") startTime: String,
        @Field("endTime") endTime: String,
        @Field("page") curPage: Int,
        @Field("limit") limit: Int
    ): Observable<BaseResponse<MutableList<BlanceDetailEntity>>>


    //留言列表
    @FormUrlEncoded
    @POST("/education/teacher/leavingMessage/getChatList")
    fun getChatList(
        @Field("token") token: String,
        @Field("page") curPage: String
    ): Observable<BaseResponse<MutableList<CommentsEntity>>>

    //给某位家长发送留言
    @FormUrlEncoded
    @POST("/education/teacher/leavingMessage/saveOrUpdate")
    fun saveOrUpdate(
        @Field("token") token: String,
        @Field("fromUserId") fromUserId: String,
        @Field("contentType") contentType: String,
        @Field("imageUrl") imageUrl: String,
        @Field("content") content: String
    ): Observable<BaseResponse<Any?>>


    //获取家教信息
    @FormUrlEncoded
    @POST("/education/teacher/education/info/getInfo")
    fun getManageInfo(
        @Field("token") token: String,
        @Field("page") curPage: String
    ): Observable<BaseResponse<MutableList<ManagesEntity>>>

    //删除家教信息
    @FormUrlEncoded
    @POST("/education/teacher/education/info/del")
    fun delInfo(
        @Field("token") token: String,
        @Field("edid") fromUserId: String
    ): Observable<BaseResponse<Any?>>

    //获取教师资历
    @FormUrlEncoded
    @POST("/education/teacher/seniority/getInfo")
    fun seniorityGetInfo(
        @Field("token") token: String
    ): Observable<BaseResponse<SeniorityEntity>>

    //设置教师的教学资历
    @FormUrlEncoded
    @POST("/education/teacher/seniority/saveOrUpdate")
    fun senioritySaveOrUpdate(
        @Field("token") token: String,
        @Field("name") name: String,
        @Field("headImageUrl") headImageUrl: String,
        @Field("age") age: String,
        @Field("synopsis") synopsis: String,
        @Field("undergo") undergo: String,
        @Field("phone") phone: String
    ): Observable<BaseResponse<Any?>>


    //获取私教的订单列表
    @FormUrlEncoded
    @POST("/education/teacher/education/pay/getList")
    fun getTutorOrderList(
        @Field("token") token: String,
        @Field("statuss") statuss: String,//状态:0.已付款 1.授课同意 2.授课拒绝 3.授课确认中 4.已完成 5.已评价
        @Field("page") curPage: String
    ): Observable<BaseResponse<MutableList<TutorOrderEntity>>>

    //处理私教订单
    @FormUrlEncoded
    @POST("/education/teacher/education/pay/deal")
    fun dowith(
        @Field("token") token: String,
        @Field("epid") epid: String,
        @Field("type") type: String,
        @Field("reason") reason: String
    ): Observable<BaseResponse<Any?>>

    //家教订单授课完成推送列表
    @FormUrlEncoded
    @POST("/education/teacher/teachering/confirm/getList")
    fun teacheringConfirmGetList(
        @Field("token") token: String,
        @Field("statuss") statuss: String,//处理状态 状态 0.授课确认中 1.授课对方已拒绝 2.已授课结束
        @Field("epid") epid: String,
        @Field("page") curPage: String
    ): Observable<BaseResponse<MutableList<ClassRecordEntity>>>

    //获取教师提现信息
    @FormUrlEncoded
    @POST("/education/teacher/withdrawal/getInfo")
    fun withdrawalGetInfo(
        @Field("token") token: String
    ): Observable<BaseResponse<WithdrawalEntity>>

    //教师申请提现
    @FormUrlEncoded
    @POST("/education/teacher/withdrawal/apply")
    fun withdrawalApply(
        @Field("token") token: String,
        @Field("money") money: String
    ): Observable<BaseResponse<Any?>>

    //添加银行卡
    @FormUrlEncoded
    @POST("/education/teacher/bankCard/save")
    fun addbank(
        @Field("token") token: String,
        @Field("name") name: String,
        @Field("ownCard") ownCard: String,
        @Field("bankName") bankName: String,
        @Field("address") address: String,
        @Field("bankCard") bankCard: String,
        @Field("phone") phone: String
    ): Observable<BaseResponse<Any?>>

    //获取所有学阶
    @FormUrlEncoded
    @POST("/education/teacher/level/getLevel")
    fun getLevel(
        @Field("token") token: String
    ): Observable<BaseResponse<MutableList<LevelEntity>>>

    //获取所有课程
    @FormUrlEncoded
    @POST("/education/teacher/category/getList")
    fun getCategoryList(
        @Field("token") token: String,
        @Field("father") father: String,
        @Field("page") page: String,
        @Field("limit") limit: String
    ): Observable<BaseResponse<MutableList<FatherEntity>>>

    //添加教师的家教信息
    @FormUrlEncoded
    @POST("/education/teacher/education/info/saveOrUpdate")
    fun addTeacher(
        @Field("token") token: String,
        @Field("money") money: String,
        @Field("units") units: String,
        @Field("type") type: String,
        @Field("ageStr") ageStr: String,
        @Field("level") level: String,
        @Field("content") content: String,
        @Field("seniority") seniority: String,
        @Field("oneCategory") oneCategory: String,
        @Field("twoCategory") twoCategory: String
    ): Observable<BaseResponse<Any?>>

    //充值余额下单
    @FormUrlEncoded
    @POST("/education/teacher/teacher/recharge")
    fun recharge(
        @Field("token") token: String,
        @Field("money") money: String
    ): Observable<BaseResponse<RechargeEntity>>

    //充值余额下单
    @FormUrlEncoded
    @POST("/education/teacher/app/alipay/createOrder")
    fun createOrder(
        @Field("token") token: String,
        @Field("orderId") money: String
    ): Observable<BaseResponse<CreateOrderEntity>>


    //新改版接口
    //课表
    @FormUrlEncoded
    @POST("/education/teacher/course/getMonthCourseList")
    fun getMonthCourseList(
        @Field("token") token: String,
        @Field("month") month: String
    ): Observable<BaseResponse<MutableList<CourseClassEntity>>>
    //获取某天老师的课时安排表
    @FormUrlEncoded
    @POST("/education/teacher/course/getDayCourseList")
    fun getDayCourseList(
        @Field("token") token: String,
        @Field("day") day: String
    ): Observable<BaseResponse<MutableList<CourseDayEntity>>>

    //个人中学-活动列表
    @FormUrlEncoded
    @POST("/education/teacher/researchStu/getList")
    fun getresearchStu(
        @Field("token") token: String,
        @Field("type") type: String,//获取列表类型 1.课程 2、活动 3、研学
        @Field("page") curPage: String
    ): Observable<BaseResponse<MutableList<ResearchStuEntity>>>

    //点击活动列表获取日程安排
    @FormUrlEncoded
    @POST("/education/teacher/researchStu/getCourseByCid")
    fun getCourseByCid(
        @Field("token") token: String,
        @Field("cid") cid: String,//班级ID
        @Field("page") curPage: String
    ): Observable<BaseResponse<MutableList<ResearchStuEntity>>>

    //点击日程安排获取日程详情----托管详情页
    @FormUrlEncoded
    @POST("/education/teacher/researchStu/getCourseDetail")
    fun getCourseDetail(
        @Field("classId") classId: String,
        @Field("courseId") courseId: String,
        @Field("token") token: String
    ): Observable<BaseResponse<CourseDetailEntity>>

    //进行签到
    @FormUrlEncoded
    @POST("/education/teacher/deposit/signIn")
    fun activitySignIn(
        @Field("token") token: String,
        @Field("stuid") stuid: String,
        @Field("courseId") courseId: String
    ): Observable<BaseResponse<Any?>>

    //取消签到
    @FormUrlEncoded
    @POST("/education/teacher/deposit/signOut")
    fun outSignIn(
        @Field("token") token: String,
        @Field("stuid") stuid: String,
        @Field("courseId") courseId: String
    ): Observable<BaseResponse<Any?>>
    //个人中心-托管列表
    @FormUrlEncoded
    @POST("/education/teacher/researchStu/getTgCourseList")
    fun getTgCourseList(
        @Field("token") token: String,
        @Field("page") curPage: String
    ): Observable<BaseResponse<MutableList<TgCourseListEntity>>>

    //获取知识点列表
    @FormUrlEncoded
    @POST("/education/teacher/knowledge/getList")
    fun knowledgeList(
        @Field("courseId") courseId: String,//课程id
        @Field("keyword") keyword: String,//标题或者内容
        @Field("currentCourse") currentCourse: String,//是否查询本课时下已添加的知识点，1:表示是 不传表示获取所有知识点列表
        @Field("page") curPage: String,
        @Field("token") token: String
    ): Observable<BaseResponse<MutableList<KnowledgeListEntity>>>

    //知识点与习题编辑页面-选择习题(获取本课时下已添加的习题列表也用这个)
    @FormUrlEncoded
    @POST("/education/teacher/exercise/getList")
    fun exerciseGetList(
        @Field("courseId") courseId: String,//课程id
        @Field("keyword") keyword: String,//标题或者内容
        @Field("currentCourse") currentCourse: String,//是否查询本课时下已添加的知识点，1:表示是 不传表示获取所有知识点列表
        @Field("type") type: String,//标题或者内容
        @Field("page") curPage: String,
        @Field("token") token: String
    ): Observable<BaseResponse<MutableList<XitiListEntity>>>

    //编写知识点-保存或修改知识点
    @FormUrlEncoded
    @POST("/education/teacher/knowledge/saveOrUpdate")
    fun knowledgesaveOrUpdate(
        @Field("token") token: String,
        @Field("id") id: String,//知识点id，修改的时候必须传
        @Field("courseId") courseId: String,
        @Field("title") title: String,
        @Field("content") content: String,
        @Field("ifStore") ifStore: String
    ): Observable<BaseResponse<Any?>>

    //选择知识点界面-提交选中的知识点
    @FormUrlEncoded
    @POST("/education/teacher/knowledge/submitSelect")
    fun knowledgeSubmitSelect(
        @Field("token") token: String,
        @Field("id") id: String,
        @Field("courseId") courseId: String
    ): Observable<BaseResponse<Any?>>

    //删除知识点
    @FormUrlEncoded
    @POST("/education/teacher/knowledge/del")
    fun knowledgeDel(
        @Field("token") token: String,
        @Field("id") id: String
    ): Observable<BaseResponse<Any?>>

    //删除习题
    @FormUrlEncoded
    @POST("/education/teacher/exercise/del")
    fun exerciseDel(
        @Field("token") token: String,
        @Field("id") id: String
    ): Observable<BaseResponse<Any?>>

    //保存或修改习题
    @FormUrlEncoded
    @POST("/education/teacher/exercise/saveOrUpdate")
    fun saveTi(
        @Field("id") id: String,
        @Field("courseId") courseId: String,
        @Field("question") question: String,//答案选项 ，选项之间使用~~~分隔
        @Field("answer") answer: String,//答案：如果是单选，则存储单选答案的内容，多选则以@@@分隔各个答案，解答题直接存储答案，判断题直接存储对的那个
        @Field("type") type: String,
        @Field("ifstore") ifstore: String,
        @Field("explain") explain: String,
        @Field("title") title: String,
        @Field("token") token: String
    ): Observable<BaseResponse<Any?>>


    //知识点与习题编辑页面-点击发布
    @FormUrlEncoded
    @POST("/education/teacher/course/publishCourse")
    fun publishCourse(
        @Field("id") id: String,
        @Field("token") token: String
    ): Observable<BaseResponse<Any?>>


    //获取考级工作记录列表信息
    @FormUrlEncoded
    @POST("/education/teacher/grading/getAllList")
    fun gradingList(
        @Field("schoolname") schoolname: String,//学校
        @Field("majorId") majorId: String,//专业id
        @Field("studentName") studentName: String,//考试人姓名
        @Field("kstartTime") kstartTime: String,
        @Field("kendTime") kendTime: String,
        @Field("status") status: String,//考级状态
        @Field("organId") organId: String,//学校id(如果搜索时选择了学校，只需传学校id，不需再传学校名称)
        @Field("token") token: String
    ): Observable<BaseResponse<GradingListEntity>>



    //关于
    @FormUrlEncoded
    @POST("/education/family/common/getAboutInfo")
    fun getAboutInfo(
        @Field("type") type: String,//
        @Field("token") token: String
    ): Observable<BaseResponse<AboutEntity>>

    //关于
    @FormUrlEncoded
    @POST("/education/family/common/checkAppUpdate")
    fun getAppUpdate(
        @Field("type") type: String,//
        @Field("token") token: String
    ): Observable<BaseResponse<AppInfoEntity>>
    //提交举报
    @FormUrlEncoded
    @POST("/education/teacher/index/submitComplaint")
    fun submitComplaint(
        @Field("content") content: String,//
        @Field("imageUrl") imageUrl: String,//
        @Field("deviceModel") deviceModel: String,//
        @Field("systemVersion") systemVersion: String,//
        @Field("version") version: String,//
        @Field("token") token: String
    ): Observable<BaseResponse<Any?>>


    //===============================================  新家教端接口
    //获得家教进行中的列表
    @FormUrlEncoded
    @POST("/education/teacher/familyeduAppoint/getAllList")
    fun familyeduAppoint(
        @Field("token") token: String
    ): Observable<BaseResponse<MutableList<FamilyeduAppointEntity>>>


    //获取教师的个人信息
    @FormUrlEncoded
    @POST("/education/teacher/teacher/info")
    fun getTeacherInfos(
        @Field("token") token: String
    ): Observable<BaseResponse<UserEntity>>

    //获取所有的分类   科目
    @FormUrlEncoded
    @POST("/education/teacher/category/getAllList")
    fun category(
        @Field("token") token: String
    ): Observable<BaseResponse<MutableList<CategoryListEntity>>>



 //分页获取消课记录列表
    @FormUrlEncoded
    @POST("/education/teacher/familyeduCelcrs/getList")
    fun familyeduCelcrs(
        @Field("token") token: String,
        @Field("appointId") appointId: String,
        @Field("page") page: String,
        @Field("limit") limit: String
    ): Observable<BaseResponse<MutableList<FamilyeduCelcrsEntity>>>


    //发起消课
    @FormUrlEncoded
    @POST("/education/teacher/familyeduCelcrs/addCelcrs")
    fun cancelCourse(
        @Field("appointId") appointId: String,//
        @Field("crsNum") crsNum: String,//
        @Field("token") token: String
    ): Observable<BaseResponse<Any?>>

    //发起消课提醒
    @FormUrlEncoded
    @POST("/education/teacher/familyeduCelcrs/notice")
    fun cancelCourseNotice(
        @Field("celcrsId") appointId: String,//消课记录id
        @Field("token") token: String
    ): Observable<BaseResponse<Any?>>
    //家教老师撤销消课
    @FormUrlEncoded
    @POST("/education/teacher/familyeduCelcrs/cancelCelcrs")
    fun cancelCelcrs(
        @Field("celcrsId") appointId: String,//消课记录id
        @Field("token") token: String
    ): Observable<BaseResponse<Any?>>


    //获取订单列表
    @FormUrlEncoded
    @POST("/education/teacher/orders/getList")
    fun getOrderList(
        @Field("token") token: String,
        @Field("status") status: String,//不填代表全部；14代表待确认；0代表待付款；100代表退款
        @Field("page") page: String,
        @Field("limit") limit: String
    ): Observable<BaseResponse<MutableList<POrderListEntity>>>

    //钱包明细列表
    @FormUrlEncoded
    @POST("/education/teacher/balanceDetails/getList")
    fun balanceDetails(
        @Field("token") token: String,
        @Field("timeType") type: String,//
        @Field("page") page: String,
        @Field("limit") limit: String
    ): Observable<BaseResponse<MutableList<PbalanceDetailsListEntity>>>

    //获取余额明细详情
    @FormUrlEncoded
    @POST("/education/teacher/balanceDetails/detail")
    fun getBalanceDetails(
        @Field("token") token: String,
        @Field("id") id: String//
    ): Observable<BaseResponse<PbalanceDetailsEntity>>


    //绑定提现账户
    @FormUrlEncoded
    @POST("/education/teacher/familyeduCard/addOrUpdate")
    fun addBankUpdate(
        @Field("name") name: String,//
        @Field("personCard") personCard: String,//
        @Field("bankCard") bankCard: String,//
        @Field("address") bank: String,//
        @Field("code") code: String,//
        @Field("token") token: String
    ): Observable<BaseResponse<Any?>>

    //根据银行卡号获取银行名称
    @FormUrlEncoded
    @POST("/education/teacher/common/getBankNameByNum")
    fun getBankNameByNum(
        @Field("bankNum") bankNum: String,//
        @Field("token") token: String
    ): Observable<BaseResponse<Any?>>


    //获取提现账户信息
    @FormUrlEncoded
    @POST("/education/teacher/familyeduCard/info")
    fun familyeduCardinfo(
        @Field("token") token: String
    ): Observable<BaseResponse<FamilyeduCardEntity>>

    //订单id获取订单详情
    @FormUrlEncoded
    @POST("/education/teacher/orders/getById")
    fun orderDetail(
        @Field("token") token: String,
        @Field("id") id: String
    ): Observable<BaseResponse<POrderDetailEntity>>

    //订单号获取订单详情
    @FormUrlEncoded
    @POST("/education/teacher/orders/getByOrderNo")
    fun orderDetailByNo(
        @Field("token") token: String,
        @Field("orderNo") orderNo: String
    ): Observable<BaseResponse<POrderDetailEntity>>

    //查询退款进度
    @FormUrlEncoded
    @POST("/education/teacher/orders/getRefundProcess")
    fun refundProcess(
        @Field("token") token: String,
        @Field("orderId") orderId: String
    ): Observable<BaseResponse<RefundProcessEntity>>


    //退款处理意见，同意或者拒绝
    @FormUrlEncoded
    @POST("/education/teacher/orders/delRefund")
    fun delRefund(
        @Field("orderId") orderId: String,//
        @Field("type") type: String,//
        @Field("remark") remark: String,//
        @Field("token") token: String
    ): Observable<BaseResponse<Any?>>

    //关闭订单
    @FormUrlEncoded
    @POST("/education/teacher/orders/close")
    fun ordersClose(
        @Field("orderId") orderId: String,//
        @Field("token") token: String
    ): Observable<BaseResponse<Any?>>

    //发送缴费申请
    @FormUrlEncoded
    @POST("/education/teacher/orders/sendConfirmAppoint")
    fun sendConfirmAppoint(
        @Field("orderId") orderId: String,//
        @Field("token") token: String
    ): Observable<BaseResponse<Any?>>

    //是否招募
    @FormUrlEncoded
    @POST("/education/teacher/teacher/setIfJiajiao")
    fun setIfJiajiao(
        @Field("ifJiajiao") ifJiajiao: String,//
        @Field("token") token: String
    ): Observable<BaseResponse<Any?>>

    //获取单条预约信息
    @FormUrlEncoded
    @POST("/education/teacher/familyeduAppoint/getById")
    fun familyeduAppoint(
        @Field("token") token: String,
        @Field("appointId") appointId: String
    ): Observable<BaseResponse<FamilyeduAppointEntity>>

}